package leetcode.offer;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2/20/2022 9:45 AM
 */
@Slf4j
public class offer16 {

    @Test
    public void test() {
        log.info(String.valueOf(myPow(2.00000, 10)));
    }


    public double myPow(double x, int n) {
        Float result = new Float(x);
        for (int i = 0; i < n - 1; i++) {
            result *= new Float(x);
        }
        return result;
    }

}
